package com.well.menjin.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.well.menjin.dao.IRoomDao;
import com.well.menjin.domain.Room;
import com.well.menjin.model.Sort;
import com.well.menjin.service.IRoomService;
/**
 * 
* @ClassName: RoomServiceImpl 
* @Description: 房间实现业务层
* @author 姜俊健 
* @date 2016年7月8日 下午1:41:37 
*
 */
@Service
@Transactional
public class RoomServiceImpl implements IRoomService{

	@Autowired
	private IRoomDao roomdao;
	@Override
	public List<Room> getRooms(int start, int limit, int page, List<Sort> sorts2, String controllerid, String roomname,
			String ipaddress) {
		List<Room> rooms = roomdao.getRooms(start,limit,page,sorts2,controllerid,roomname,ipaddress);
		return rooms;
	}
	
	@Override
	public int getRoomsCount(String controllerid, String roomname, String ipaddress) {
		List<Room> rooms = roomdao.getRoomsCount(controllerid,roomname,ipaddress);
		return rooms.size();
	}

}
